import Taro from '@tarojs/taro'
import React, { PureComponent } from 'react'
// 界面组件
import { View, Text } from '@tarojs/components'

import CTopbar from '@/components/CTopBar/index'

import './index.scss'
import CImage from '@/components/CImage'
import { get_about_us_api } from './service'
import about_us_img from '@/assets/about_us.jpg'
import GetTopBarInfo from '@/utils/GetTopBarInfo' //动态高度
/**
 * 关于我们界面
 */
class AboutUs extends PureComponent<any> {
  constructor(props) {
    super(props)
    this.state = {
      about_us_info: {
        applets: {},
        people: [],
      },
    }
  }
  componentWillMount() {
    this.get_about_us()
  }
  get_about_us() {
    get_about_us_api().then(({ result, data }) => {
      this.setState({
        about_us_info: data,
      })
    })
  }
  render() {
    const {
      about_us_info: { applets = {}, people = [] },
    } = this.state

    return (
      <View style={{ paddingTop: `${GetTopBarInfo().TopBarHeight}px` }}>
        <CTopbar title='关于我们' showBack></CTopbar>
        <View className='content'>
          <View>
            <View className='at-row at-row__justify--center'>
              <View className='at-col at-col-8'>
                <View className='bg'>
                  <CImage src={about_us_img}></CImage>
                </View>
              </View>
            </View>
          </View>
          <View className='title'>简介</View>
          <View className='content_2'>{applets ? applets.appletsBriefIntroduction : ''}</View>

          <View className='title'>创始人</View>
          <View>
            <View className='at-row'>
              <View className='at-col at-col-5'>
                <CImage src={people[0] ? people[0].nameImg : ''}></CImage>
              </View>
              <View className='at-col'>
                <View>{people[0] ? people[0].name : ''}</View>
                <View style='color:#A9A9A9'>{people[0] ? people[0].brieIntroduction : ''}</View>
              </View>
            </View>
          </View>
          {/* 
          <View className='title'>简介</View>
          <View className='content_2'>手机打开就打算开店哈克多久阿什科夫等哈看的哈结婚·</View> */}
        </View>
      </View>
    )
  }
}

export default AboutUs
